package com.y.lintcode;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author Y2014188432
 * Fizz Buzz 问题
 */
public class Test6 {
    public static void main(String[] args) {
        int n = 15;
        System.out.println(process(n));
    }
    public static List<String> process(int n){
        List<String> result = new ArrayList<>();
        //实现过程
        for (int i = 1; i <= n; i++) {
            String temp = "";
            if (i %3 == 0 || i %5 ==0) {
                temp = (i %3 == 0 && i %5 ==0)?"fizz buzz":(i%3==0)?"fizz":"buzz";
            } else {
                temp = String.valueOf(i);
            }
            result.add(temp);
        }
        return result;
    }
}
